package pms.employee;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import pms.contract.service.GenericGenerator;
import pms.employee.admin.domain.Employee;

public class EmployeeEntityGenerator extends GenericGenerator {

	@Autowired
	EmployeeManager employeeManager;

	@Test
	public void gen_employee() 
	{
		for (int i = 0; i < 10; i++) 
		{
			Employee employee = new Employee();
			employee.setName("employee_" + i);
			this.employeeManager.save(employee);
			for (int j = 0; j < 10; j++) 
			{
				Employee e = new Employee();
				e.setName("employee_" + i + "_" + j);
				e.setAge(15+i);
				e.setPerformance("good"+ i + "_" + j);
				e.setUserRatings(i);
				employee = this.employeeManager.save(e);
				this.employeeManager.save(employee);
			}
		}
	}
}
